//
//  AViewController.m
//  BriefBookAnimation
//
//  Created by Burn on 2019/6/27.
//  Copyright © 2019 menksoft. All rights reserved.
//

#import "AViewController.h"
#import "BViewController.h"
#import "InteractiveTransition.h"

@interface AViewController ()<BViewControllerDelegate>

@property(strong,nonatomic) InteractiveTransition *interactiveTransition;

@end

@implementation AViewController



- (void)viewDidLoad {
    [super viewDidLoad];
    
    self.interactiveTransition = [InteractiveTransition interactiveTransitionWithTransitionType:InteractiveTransitionTypePresent GestureDirection:GestureDirecationUp];
    
    __weak typeof(self) weakSelf = self;
    self.interactiveTransition.presentConifg = ^{
        [weakSelf present:nil];
    };
    [self.interactiveTransition addPanGestureForViewController:self];
}

- (IBAction)present:(id)sender {
    BViewController *vc = [[BViewController alloc]init];
    vc.delegate = self;
    [self presentViewController:vc animated:YES completion:nil];
}


- (id<UIViewControllerInteractiveTransitioning>)interactiveTransitionForPresent{
    return self.interactiveTransition;
}
@end
